package com.config;


import com.controller.index.UserController;
import com.controller.index.ValidCodeController;
import com.controller.secretary.SumaryKickOpenReportController;
import com.controller.secretary.keytimeController;
import com.controller.secretary.report;
import com.controller.secretary.setSecretaryController;
import com.controller.secretary.thesissourceController;
import com.controller.stu.AccountController;
import com.controller.stu.DissertationController;
import com.controller.stu.thesisprogressrecordController;
import com.controller.teacher.DissertationControllerTea;
import com.controller.teacher.StaController;
import com.controller.teacher.MediumterminspectionController;
import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.c3p0.C3p0Plugin;
import com.jfinal.render.ViewType;
import com.model.Mediumterminspection;
import com.model.PaperKeyTime;
import com.model.Student;
import com.model.Studis;
import com.model.Teacher;
import com.model.Thesisprogressrecord;
import com.model.Thesissource;
import com.model.Thesistitle;
import com.model.User;
import com.word.word2swfController;



public class Config extends JFinalConfig{

	@Override
	public void configConstant(Constants me) {
		// TODO Auto-generated method stub
//		loadPropertyFile("datasource.properties"); 
		me.setDevMode(true);
		
		me.setViewType(ViewType.JSP);
	}

	@Override
	public void configHandler(Handlers arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configInterceptor(Interceptors arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configPlugin(Plugins me) {
		// TODO Auto-generated method stub"jdbc:mysql://localhostgl?zeroDateTimeBehavior=convertToNull"
				C3p0Plugin cp = new C3p0Plugin("jdbc:mysql://120.24.209.91:3306/lwgl?zeroDateTimeBehavior=convertToNull", "stu","student");
				me.add(cp);
				ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);
				me.add(arp);
				
//				arp.addMapping("sta", Sta.class);
				arp.setShowSql(true);
				arp.addMapping("student_rela_thesistitle","stu_rela_thesis_id",Studis.class);//学生论文表
		        //arp.addMapping("check_opening_report",Massage.class);//意见表
			    arp.addMapping("thesistitle","thesistitle_id",Thesistitle.class);//论文表
			    arp.addMapping("student","student_id",User.class);
			    arp.addMapping("teacher", "teacher_id",Teacher.class);
			    arp.addMapping("mediumterminspection", "medium_id", Mediumterminspection.class);
				arp.addMapping("student","student_id",Student.class);
		        arp.addMapping("thesissource","thesissource_id",Thesissource.class);
		        arp.addMapping("paperkeytime","keytime_id", PaperKeyTime.class);
		        arp.addMapping("thesisprogressrecord","prorec_id", Thesisprogressrecord.class);
		        
		        
	}

	@Override
	public void configRoute(Routes me) {
		// TODO Auto-generated method stub
		me.add("/",UserController.class);
		me.add("/account",AccountController.class);
		me.add("/mediu",MediumterminspectionController.class);
		me.add("/secretary-keytime",keytimeController.class);
		me.add("secretary-ts",thesissourceController.class);
		me.add("/validcode",ValidCodeController.class);
		me.add("/StaIndex",StaController.class);
		me.add("/word2swf",word2swfController.class);
		me.add("/DissertationControllerTea",DissertationControllerTea.class);
		me.add("/DissertationController",DissertationController.class);
//		me.add("/dissertation",  DissertationController.class);
		me.add("/index",StaController.class);
//		me.add("/dissertationtea",  DissertationControllerTea.class);
		me.add("/xsxt", DissertationController.class);//学生用的	
		me.add("/thesisprogressrecord",thesisprogressrecordController.class);
		me.add("/SumaryKickOpenReportController",SumaryKickOpenReportController.class);
		me.add("/report",report.class);
		me.add("/setSecretary",setSecretaryController.class);
	}

}
